import { defineStore } from 'pinia'
import { BLEData } from '../const/BLEconst'

export const blestore = defineStore("ble", {
    state() {
      
        const bleList:Array<BLEData>=[
            { "text": "未知设备", "value": "D1E29D38-1F9A-2DA3-654E-02ECF3C9BCBE" },
            { "text": "未知设备", "value": "69C2B93A-6651-A600-355E-16695A3A6851" },
        ]
        const bleDataObj:BLEData={value:'',text:''}
        return {
            bleList:bleList,
            BLEData:bleDataObj,     
            isConnectBLE:false

        }
    },
    getters: {

    },
    actions: {
        changeBLEState(bleState:boolean){
            this.isConnectBLE =bleState

        },
        putBleData(data:BLEData){
            this.BLEData.text = data.text
            this.BLEData.value = data.value

        },

    }

})